package oppsa.util;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.table.DefaultTableCellRenderer;

public class DateRenderer extends DefaultTableCellRenderer {
    DateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
 
    public DateRenderer() {
        super();
    }      
	/*@Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JTableModel model = (JTableModel) table.getModel();
        Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
       // if(table.getModel().getValueAt(row, 13 ).toString().equals("Closed")){
       	//c.setForeground(Color.red);
       // }
        
        return c;
    }*/
    @Override
	public void setValue(Object value) {

        setText((value == null) ? "" : formatter.format((Date)value));
    }
}
